#pragma once

#include "DatabaseManager.h"

class CDbBase
{
public:
    CDbBase(CString DbName, UINT RecordSize);
    virtual ~CDbBase(void);

    virtual DWORD Open(void);
    virtual void Close(void);
    virtual UINT GetCount(void);

    bool Exists(void);

    inline DWORD Delete(UINT Index)
    { return m_DbMgr.DeleteRecord(Index); }

private:
    DWORD GetDbFile(CString *pDbFile);

public:
    static const UINT FIRST_RECORD_ID;

protected:
    CDatabaseManager m_DbMgr;
    UINT m_RecordSize;

private:
    CString m_DbName;
};
